(function LLine() {
    // 实例化对象
    var myChart = echarts.init(document.querySelector(".LLine .chart"));
    // 指定配置和数据
    var option = {
        color: ["#00f2f1", "#ed3f35", "#7171C6"],
        tooltip: {
            trigger: "axis",
            axisPointer: {
                // 坐标轴指示器，坐标轴触发有效
                type: "shadow" // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        grid: {
            left: "0%",
            top: "10px",
            right: "0%",
            bottom: "4%",
            containLabel: true
        },
        xAxis: {
            type: 'category',
            // 去除刻度
            axisTick: {
                show: false
            },
            // 修饰刻度标签的颜色
            axisLabel: {
                color: "rgba(255,255,255,.7)"
            },
            // 去除x坐标轴的颜色
            axisLine: {
                show: false
            },
            name: "年份",
            data: []
        },
        yAxis:  [{
            type: "value",
            // 去除刻度
            axisTick: {
                show: false
            },
            // 修饰刻度标签的颜色
            axisLabel: {
                show: true,
                color: "rgba(255,255,255,.7)",
                formatter: function (value) {
                    if (value >= 1000) {
                        value = value / 10000 + 'w';
                    }
                    return value;
                },
            },
            // 修改y轴分割线的颜色
            splitLine: {
                lineStyle: {
                    color: "#012f4a"
                }
            }
        }],
        series: [
            {
                name: "本科一批",
                type: 'line',
                smooth: true,
                data: []
            },{
                name: "本科二批",
                type: 'line',
                smooth: true,
                data: []
            },{
                name: "专科批",
                type: 'line',
                smooth: true,
                data: []
            }
        ]
    };
    $.ajax({
        url: 'http://localhost:8080/text1',
        type: 'get',
        dataType: 'json',
        success: function (res) {
            var time = [];
            var grade1 = [];
            // var results = []
            for (let i = 0; i < res.length; i++) {
                time[i] = res[i]["time"]
                grade1[i] = res[i]["grade"]

                // results.push({name: time[i], value: grade1[i]})
            }
            console.log(time);
            console.log(grade1);
            option.xAxis.data = time;
            option.series[0].data = grade1;

        }
    });
    $.ajax({
        url: 'http://localhost:8080/text2',
        type: 'get',
        dataType: 'json',
        success: function (res) {
            // var time = [];
            var grade2 = [];
            // var results = []
            for (let i = 0; i < res.length; i++) {
                time[i] = res[i]["time"]
                grade2[i] = res[i]["grade"]

                // results.push({name: time[i], value: grade[i]})
            }
            // console.log(time);
            console.log(grade2);
            // option.xAxis.data = time;
            option.series[1].data = grade2;
            myChart.setOption(option);
        }
    });
    $.ajax({
        url: 'http://localhost:8080/text3',
        type: 'get',
        dataType: 'json',
        success: function (res) {
            // var time = [];
            var grade3 = [];
            // var results = []
            for (let i = 0; i < res.length; i++) {
                // time[i] = res[i]["time"]
                grade3[i] = res[i]["grade"]

                // results.push({name: time[i], value: grade[i]})
            }
            // console.log(time);
            console.log(grade3);
            // option.xAxis.data = time;
            option.series[2].data = grade3;
            myChart.setOption(option);
        }
    });
    // option.xAxis[0].data = time;
    // option.series[0].data = grade;
    // // 把配置给实例对象
    // myChart.setOption(option);
    window.addEventListener("resize", function () {
        myChart.resize();
    })
}) ();

(function to10() {
    // 实例化对象
    var myChart = echarts.init(document.querySelector(".pie .chart"));
    // 指定配置和数据
    var option = {
        color: ["#00f2f1", "#ed3f35", "#7171C6"],
        tooltip: {
            trigger: "axis",
            axisPointer: {
                // 坐标轴指示器，坐标轴触发有效
                type: "shadow" // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        grid: {
            left: "0%",
            top: "10px",
            right: "0%",
            bottom: "4%",
            containLabel: true
        },
        yAxis: [
            {
                data: [],
                type: "category",
                axisTick: {
                    alignWithLabel: true
                },
                axisLabel: {
                    textStyle: {
                        color: "rgba(255,255,255)",
                        fontSize: "10"
                    }
                },
                axisLine: {
                    show: false
                }
            }
        ],
        xAxis: [
            {
                type: "value",
                axisLabel: {
                    show: true,
                    color: "rgba(255,255,255,.7)",
                    fontSize:"10",
                    formatter: function (value) {
                        if (value >= 1000) {
                            value = value / 10000 + 'w';
                        }
                        return value;
                    },
                },
                axisLine: {
                    lineStyle: {
                        color: "rgba(255,255,255,.1)"
                        // width: 1,
                        // type: "solid"
                    }
                },
                splitLine: {
                    lineStyle: {
                        color: "rgba(255,255,255,.1)"
                    }
                }
            }
        ],
        series: [{
            type: 'bar',
            barWidth: "35%",
            smooth: true,
            itemStyle: {
                color: "#1089E7",
                barBorderRadius: 6
            },
            name: "最低分 ",
            data: []
        }]

    };
    $.ajax({
        url: 'http://localhost:8080/l/select21',
        type: 'get',
        dataType: 'json',
        success: function (res) {
            var name = [];
            var minScore = [];
            // var results = []
            for (let i = 0; i < res.length; i++) {
                name[i] = res[i]["schoolName"]
                minScore[i] = res[i]["minScore"]

                // results.push({name: time[i], value: grade1[i]})
            }
            console.log(name);
            console.log(minScore);
            option.yAxis[0].data = name;
            option.series[0].data = minScore;
            myChart.setOption(option);
        }
    });


    // option.xAxis[0].data = time;
    // option.series[0].data = grade;
    // // 把配置给实例对象
    myChart.setOption(option);
    window.addEventListener("resize", function () {
        myChart.resize();
    })
}) ();

(function tow10() {
    // 实例化对象
    var myChart = echarts.init(document.querySelector(".pie2 .chart"));
    // 指定配置和数据
    var option = {
        color: ["#00f2f1", "#ed3f35", "#7171C6"],
        tooltip: {
            trigger: "axis",
            axisPointer: {
                // 坐标轴指示器，坐标轴触发有效
                type: "shadow" // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        grid: {
            left: "0%",
            top: "10px",
            right: "0%",
            bottom: "4%",
            containLabel: true
        },
        yAxis: [
            {
                data: [],
                type: "category",
                axisTick: {
                    alignWithLabel: true
                },
                axisLabel: {
                    textStyle: {
                        color: "rgba(255,255,255)",
                        fontSize: "10"
                    }
                },
                axisLine: {
                    show: false
                }
            }
        ],
        xAxis: [
            {
                type: "value",
                axisLabel: {
                    show: true,
                    color: "rgba(255,255,255,.7)",
                    fontSize:"10",
                    formatter: function (value) {
                        if (value >= 1000) {
                            value = value / 10000 + 'w';
                        }
                        return value;
                    },
                },
                axisLine: {
                    lineStyle: {
                        color: "rgba(255,255,255,.1)"
                        // width: 1,
                        // type: "solid"
                    }
                },
                splitLine: {
                    lineStyle: {
                        color: "rgba(255,255,255,.1)"
                    }
                }
            }
        ],
        series: [{
            type: 'bar',
            barWidth: "35%",
            smooth: true,
            itemStyle: {
                color: "#1089E7",
                barBorderRadius: 6
            },
            name: "最低分 ",
            data: []
        }]

    };
    $.ajax({
        url: 'http://localhost:8080/w/select21',
        type: 'get',
        dataType: 'json',
        success: function (res) {
            var name = [];
            var minScore = [];
            // var results = []
            for (let i = 0; i < res.length; i++) {
                name[i] = res[i]["schoolName"]
                minScore[i] = res[i]["minScore"]

                // results.push({name: time[i], value: grade1[i]})
            }
            console.log(name);
            console.log(minScore);
            option.yAxis[0].data = name;
            option.series[0].data = minScore;
            myChart.setOption(option);
        }
    });


    // option.xAxis[0].data = time;
    // option.series[0].data = grade;
    // // 把配置给实例对象
    myChart.setOption(option);
    window.addEventListener("resize", function () {
        myChart.resize();
    })
}) ();

(function WLine() {
    // 实例化对象
    var myChart = echarts.init(document.querySelector(".WLine .chart"));
    // 指定配置和数据
    var option = {
        color: ["#00f2f1", "#ed3f35", "#7171C6"],
        tooltip: {
            trigger: "axis",
            axisPointer: {
                // 坐标轴指示器，坐标轴触发有效
                type: "shadow" // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        grid: {
            left: "0%",
            top: "10px",
            right: "0%",
            bottom: "4%",
            containLabel: true
        },
        xAxis: {
            type: 'category',
            // 去除刻度
            axisTick: {
                show: false
            },
            // 修饰刻度标签的颜色
            axisLabel: {
                color: "rgba(255,255,255,.7)"
            },
            // 去除x坐标轴的颜色
            axisLine: {
                show: false
            },
            name: "年份",
            data: []
        },
        yAxis:  [{
            type: "value",
            // 去除刻度
            axisTick: {
                show: false
            },
            // 修饰刻度标签的颜色
            axisLabel: {
                show: true,
                color: "rgba(255,255,255,.7)",
                formatter: function (value) {
                    if (value >= 1000) {
                        value = value / 10000 + 'w';
                    }
                    return value;
                },
            },
            // 修改y轴分割线的颜色
            splitLine: {
                lineStyle: {
                    color: "#012f4a"
                }
            }
        }],
        series: [
            {
                name: "本科一批",
                type: 'line',
                smooth: true,
                data: []
            },{
                name: "本科二批",
                type: 'line',
                smooth: true,
                data: []
            },{
                name: "专科批",
                type: 'line',
                smooth: true,
                data: []
            }
        ]
    };
    $.ajax({
        url: 'http://localhost:8080/w1',
        type: 'get',
        dataType: 'json',
        success: function (res) {
            var time = [];
            var grade1 = [];
            // var results = []
            for (let i = 0; i < res.length; i++) {
                time[i] = res[i]["time"]
                grade1[i] = res[i]["grade"]

                // results.push({name: time[i], value: grade1[i]})
            }
            console.log(time);
            console.log(grade1);
            option.xAxis.data = time;
            option.series[0].data = grade1;

        }
    });
    $.ajax({
        url: 'http://localhost:8080/w2',
        type: 'get',
        dataType: 'json',
        success: function (res) {
            // var time = [];
            var grade2 = [];
            // var results = []
            for (let i = 0; i < res.length; i++) {
                time[i] = res[i]["time"]
                grade2[i] = res[i]["grade"]

                // results.push({name: time[i], value: grade[i]})
            }
            // console.log(time);
            console.log(grade2);
            // option.xAxis.data = time;
            option.series[1].data = grade2;
            myChart.setOption(option);
        }
    });
    $.ajax({
        url: 'http://localhost:8080/w3',
        type: 'get',
        dataType: 'json',
        success: function (res) {
            // var time = [];
            var grade3 = [];
            // var results = []
            for (let i = 0; i < res.length; i++) {
                // time[i] = res[i]["time"]
                grade3[i] = res[i]["grade"]

                // results.push({name: time[i], value: grade[i]})
            }
            // console.log(time);
            console.log(grade3);
            // option.xAxis.data = time;
            option.series[2].data = grade3;
            myChart.setOption(option);
        }
    });
    // option.xAxis[0].data = time;
    // option.series[0].data = grade;
    // // 把配置给实例对象
    // myChart.setOption(option);
    window.addEventListener("resize", function () {
        myChart.resize();
    })
}) ();


(function f958() {
    $.ajax({
        url: 'http://localhost:8080/985',
        type: 'get',
        dataType: 'json',
        success: function (res) {
            // var name = [];
            var r = [];
            // var results = []
            for (let i = 0; i < res.length; i++) {
                // name[i]= res[i]["name"]
                r[i] = res[i]['counts']

            }
            console.log(r);
            $('#985').text(r);
        }
    });
    $.ajax({
        url: 'http://localhost:8080/211',
        type: 'get',
        dataType: 'json',
        success: function (res) {
            // var name = [];
            var r = [];
            // var results = []
            for (let i = 0; i < res.length; i++) {
                // name[i]= res[i]["name"]
                r[i] = res[i]['counts']

            }
            $('#211').text(r);
        }
    });
}) ();